//
//  IComMediator+ContactsModuleActions.m
//  ICome
//
//  Created by zhangrongwu on 2016/10/31.
//  Copyright © 2016年 iCom. All rights reserved.
//

#import "IComMediator+ContactsModuleActions.h"

@implementation IComMediator (ContactsModuleActions)
NSString * const kIComMediatorTargetContacts = @"Contacts";

NSString * const kIComNativeFetchContactsViewController = @"nativeFetchContactsViewController";
NSString * const kIComNativeFetchContactsDetailViewController = @"nativeFetchContactsDetailViewController";
NSString * const kIComNativeFetchRobotDetailViewController = @"nativeFetchRobotDetailViewController";

- (UIViewController *)IComMediator_ContactsViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetContacts
                                                    action:kIComNativeFetchContactsViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        // view controller 交付出去之后，可以由外界选择是push还是present
        return viewController;
    } else {
        // 这里处理异常场景，具体如何处理取决于产品
        return [[UIViewController alloc] init];
    }
}

- (UIViewController *)IComMediator_ContactsDetailViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetContacts
                                                    action:kIComNativeFetchContactsDetailViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        // view controller 交付出去之后，可以由外界选择是push还是present
        return viewController;
    } else {
        // 这里处理异常场景，具体如何处理取决于产品
        return [[UIViewController alloc] init];
    }
}


- (UIViewController *)IComMediator_RobotDetailViewController:(NSDictionary *)params
{
    UIViewController *viewController = [self performTarget:kIComMediatorTargetContacts
                                                    action:kIComNativeFetchRobotDetailViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        // view controller 交付出去之后，可以由外界选择是push还是present
        return viewController;
    } else {
        // 这里处理异常场景，具体如何处理取决于产品
        return [[UIViewController alloc] init];
    }
}
@end
